package cn.iocoder.yudao.module.crossborder.order.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 跨境电商支付状态枚举
 *
 * @author LHL
 */
@AllArgsConstructor
@Getter
public enum PaymentStatusEnum {

    UNPAID(10, "未支付"),
    PARTIAL_PAID(20, "部分支付"),
    PAID(30, "已支付"),
    PAYMENT_FAILED(40, "支付失败"),
    REFUNDED(50, "已退款"),
    PARTIAL_REFUNDED(60, "部分退款"),
    ;

    /**
     * 状态值
     */
    private final Integer status;
    
    /**
     * 状态名称
     */
    private final String name;

    public static PaymentStatusEnum getByStatus(Integer status) {
        for (PaymentStatusEnum value : values()) {
            if (value.getStatus().equals(status)) {
                return value;
            }
        }
        return null;
    }

}
